<?php

namespace app\model;


class InsurantModel extends BaseModel
{
    protected $table = 'insurant';


    public function getinsurantStepListPage($page,$pageSize,$condition=[],$is_count = false,$order=''){
        $condition['p.delete_ts'] = self::DELETED;
        $join=[
            ['policy p','i.p_id=p.p_id','LEFT'],
            ['user_info u','u.ui_id=p.remer_id','LEFT'],
        ];
        $this->alias('i')
            ->field('p.policy_num,u.username,u.company_name,i.*')
            ->join($join);
        if($condition){
            $this->where($condition);
        }
        if($order){
            $this->order($order);
        }
        if($is_count){
            return $this->count();
        }
        return $this->page($page,$pageSize)->select();
    }

}